/**
 * Created by yu on 16/8/22.
 * 处理路径
 */

var fs = require('fs');

var path = require('path');

//合并 连接路径    console.log(files);

console.log(path.join('./book','mysql'));
//seperator 分割符
console.log(path.sep);//获得路径分割符

console.log(__filename);//获取当前文件的绝对路径

console.log(__dirname);//获取当前模块所在的绝对路径

console.log(path.basename('./files/name/index.js'));//获得文件名
console.log(path.basename('./files/name/index.js','.js'));//获得文件名 去掉.js后缀
console.log(path.extname('./files/name/index.js'));//获得文件后缀

//从一个相对路径,解析出一个绝对路径.以应用程序的所在目录为根起点
console.log(path.resolve());

console.log(path.resolve('book','node.js','..','mysql.json'));

